package sctu.edu.java.year2016.team05.wangliwei.day20160519.chapter4_2;

/**
 *编写java程序，应用for循环打印菱形。
 */
public class lx {


    public static void main(String args[]) {
        int i, j, k;
        for (i = 0; i < 5; i++) {
            for (j = 0; j < 5 - i; j++)
                System.out.print(" ");
            for (k = 0; k < 2 * i - 1; k++)
                System.out.print("*");
            System.out.print("\n");
        }

        for (i = 3; i > 0; i--) {
            for (j = 0; j < 5 - i; j++)
                System.out.print(" ");
            for (k = 0; k < 2 * i - 1; k++)
                System.out.print("*");
            System.out.print("\n");


    }
}
}
